fn main() {
    let s = String::from("Hello");
    tk_ownership(s.clone());
    // 若不使用s.clone() 则下面的一行会编译错误
    println!("{}", s);

    let e = 32;
    mk_copy(e);
    println!("{}", e);

    let ms = give_ownership();
    println!("{}", ms);

    let c = String::from("SSS");
    let m = tk_and_give_ownership(c.clone());
    println!("{}",c);
    println!("{}",m);

    let mut v1 = vec![1, 2, 3, 4];
    for x in v1.iter_mut(){
        *x += 3;
    }
    println!("{:?}", v1);

}

fn tk_ownership(x: String){
    println!("{}", x);
}

fn mk_copy(y: i32){
    println!("{}", y);
}

fn give_ownership()->String{
    String::from("Hello")
}

fn tk_and_give_ownership(ast: String)->String{
    ast
}
